local zonge = fk.CreateSkill {
  name = "zonge",
}

Fk:loadTranslationTable{
  ["zonge"] = "纵恶",
  [":zonge"] = "出牌阶段限一次，你可以随机获得一名角色的一张牌，令其对随机一名角色造成1点伤害，你以此法受到伤害后摸等同已损失体力值的牌。",

  ["#zonge"] = "恶掠：随机获得一名角色一张牌，令其随机造成伤害",

  ["$zonge1"] = "",
  ["$zonge2"] = "",
}

zonge:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  target_num = 0,
  prompt = "#zonge",
  can_use = function(self, player)
    return player:usedSkillTimes(zonge.name, Player.HistoryPhase) == 0 and player.maxHp > 1
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    local targets = {}
    for _, p in ipairs(room.alive_players) do
      if not (p:isNude() or p == player) then
        table.insert(targets, p)
      end
    end
    if #targets > 0 then
      local to = table.random(targets)
      room:obtainCard(player, table.random(to:getCardIds("he")), false, fk.ReasonPrey, player, zonge.name)
      if not to.dead then
        local luckier = table.random(room.alive_players)
        room:damage{
        from = to,
        to = luckier,
        damage = 1,
        skillName = zonge.name,
        } if luckier == player then
          player:drawCards(player:getLostHp(), zonge.name)
        end 
      end
    end
  end,
})

return zonge
